package org.changchen.fgt.controller;

import org.changchen.fgt.constant.GlobalConstants;
import org.changchen.fgt.utils.ApplicationContextUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping(value = "/")
public class IndexController {

	
	@GetMapping(value = {"/","/index","/home"})
	public ModelAndView index(String wd) {
		
		String page = "index";
		
		// 移动端访问
		if((boolean) ApplicationContextUtil.get(GlobalConstants.ISMOBILE)) {
			page = "mobile/index";
		}
		
		ModelAndView model = new ModelAndView(page);
		model.addObject("word", wd);
		return model;
	}
	
	
}
